package com.sdy.dcsb.biz.service.impl;

import com.sdy.dcsb.biz.mapper.EsbInboundParamMapper;
import com.sdy.dcsb.biz.model.EsbInboundParam;
import com.sdy.dcsb.biz.service.EsbInboundParamService;
import com.sdy.mvc.service.impl.BaseServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Snaky
 */
@Slf4j
@Service
public class EsbInboundParamServiceImpl extends BaseServiceImpl<EsbInboundParam> implements EsbInboundParamService {

    @Autowired
    private EsbInboundParamMapper inboundParamMapper;

    /**
     * 获取封装接口不包含纯节点的入参信息
     *
     * @param id 接口id
     * @return 入参集合
     */
    @Override
    public List<EsbInboundParam> getInputParamWithoutPureNode(Integer id) {
        return inboundParamMapper.getInputParamWithoutPureNode(id);
    }

    /**
     * @param serviceId 接口id
     * @param paramMode 参数模式(1 入参  2 出参)
     * @return 接口的最大参数序号
     */
    @Override
    public Integer getMaxOrderNum(Integer serviceId, Integer paramMode) {
        return inboundParamMapper.getMaxOrderNum(serviceId,paramMode);
    }

    /**
     * 获取封装接口配置的出参信息
     *
     * @param id 接口id
     * @return 出参集合
     */
    @Override
    public List<EsbInboundParam> getOutputParamConf(Integer id) {
        return inboundParamMapper.getOutputParamConf(id);
    }

    /**
     * 获取接口入参格式(3 json格式、4 form-data参数、5 form-urlencoded参数)
     *
     * @param id 接口id
     * @return 入参格式
     */
    @Override
    public List<Integer> getParamFormat(Integer id) {
        return inboundParamMapper.getParamFormat(id);
    }
}
